home *** CD-ROM | disk | FTP | other *** search
- class disney.rabbitRivalry.ui.GamePlay extends disney.rabbitRivalry.ui.Screen
- {
- var __overlay;
- var __nav;
- var __help;
- var __state;
- var __hideYoMeter;
- var DOES_UPDATE = true;
- var __HAS_INTRO = true;
- var __LEVEL_INTRO_END_FRAME = 32;
- var __YANG_INTRO_END_FRAME = 45;
- var __YIN_INTRO_END_FRAME = 71;
- var __YANG_OUTRO_END_FRAME = 58;
- var __YIN_OUTRO_END_FRAME = 82;
- function GamePlay(mc, ui, overlay, nav, help)
- {
- super(mc,ui);
- this.__overlay = overlay;
- this.__nav = nav;
- this.__help = help;
- this.__state = disney.rabbitRivalry.GameState.getInstance();
- this.__hideYoMeter = false;
- }
- function update(dt)
- {
- super.update(dt);
- if(this.__state.actionState == 1)
- {
- if(this.__overlay._currentFrame >= this.__LEVEL_INTRO_END_FRAME)
- {
- this.__state.advanceState();
- this.__overlay.gotoAndPlay(!this.__state.isYang ? "yin_in" : "yang_in");
- }
- }
- else if(this.__state.actionState == 2)
- {
- if(this.__overlay._currentFrame == (!this.__state.isYang ? this.__YIN_INTRO_END_FRAME : this.__YANG_INTRO_END_FRAME))
- {
- this.assignWeaponSelectButtons();
- this.__state.advanceState();
- }
- }
- else if(this.__state.actionState == 3)
- {
- if(this.__overlay._currentFrame == (!this.__state.isYang ? this.__YIN_OUTRO_END_FRAME : this.__YANG_OUTRO_END_FRAME))
- {
- this.__state.advanceState();
- this.__overlay.gotoAndStop("hidden");
- }
- }
- }
- function updateLives()
- {
- var _loc2_ = disney.rabbitRivalry.GameState.getInstance().misses;
- while(true)
- {
- _loc2_;
- if(!_loc2_--)
- {
- break;
- }
- this.__nav["underwear_" + (_loc2_ + 1)].gotoAndStop("on");
- }
- _loc2_ = 5;
- while(_loc2_ > disney.rabbitRivalry.GameState.getInstance().misses)
- {
- this.__nav["underwear_" + _loc2_].gotoAndStop("off");
- _loc2_ = _loc2_ - 1;
- }
- }
- function updateScore()
- {
- this.__nav.scoreBoard_mc.txt_score.text = String(disney.rabbitRivalry.GameState.getInstance().score);
- }
- function onNextRabbit()
- {
- this.__overlay.gotoAndStop(32);
- }
- function onOpened()
- {
- super.onOpened();
- this.__overlay.gotoAndPlay("level");
- this.__overlay.levelNum_mc.txt_mc.textBox.text = _root.level_txt + " " + this.__state.levelNum;
- if(disney.rabbitRivalry.GameState.getInstance().levelNum == 1 || this.__nav._currentframe == 1)
- {
- this.__nav.gotoAndPlay("intro");
- }
- this.updateScore();
- this.updateLives();
- }
- function onClosed()
- {
- this.__overlay.gotoAndStop("hidden");
- super.onClosed();
- }
- function assignWeaponSelectButtons()
- {
- this.__overlay.wep_1.onRollOver = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:1});
- disney.rabbitRivalry.Sounds.getInstance().playVoiceOver("attack1");
- };
- this.__overlay.wep_1.onRelease = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:1});
- smashing.keithm.Messenger.sendMessage("screen","onSelectWeapon");
- };
- this.__overlay.wep_2.onRollOver = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:2});
- disney.rabbitRivalry.Sounds.getInstance().playVoiceOver("attack2");
- };
- this.__overlay.wep_2.onRelease = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:2});
- smashing.keithm.Messenger.sendMessage("screen","onSelectWeapon");
- };
- this.__overlay.wep_3.onRollOver = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:3});
- disney.rabbitRivalry.Sounds.getInstance().playVoiceOver("attack3");
- };
- this.__overlay.wep_3.onRelease = function()
- {
- smashing.keithm.Messenger.sendMessage("world","onSelectWeapon",{num:3});
- smashing.keithm.Messenger.sendMessage("screen","onSelectWeapon");
- };
- }
- function onSelectWeapon()
- {
- this.__overlay.gotoAndPlay(!this.__state.isYang ? "yin_out" : "yang_out");
- }
- function runResultAnim(t_args)
- {
- this.__nav.resultsAnim_mc.gotoAndPlay(2);
- this.__nav.resultsAnim_mc.text_mc.gotoAndStop(t_args.type);
- }
- function onPressHelpOpen()
- {
- this.__help.gotoAndPlay("open");
- smashing.keithm.Messenger.sendMessage("engine","pause");
- }
- function onPressHelpClose()
- {
- this.__help.gotoAndPlay("close");
- smashing.keithm.Messenger.sendMessage("engine","unpause");
- }
- function onPressPlay()
- {
- this.onPressHelpClose();
- }
- }
-